<?php
include_once "filtro_cabecera.php";
include_once "../funciones/funciones_php.php";
include_once("menu_operacion.php");
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Enviar formulario sin recargar</title>
<!--<script language="javascript" src="jquery-1.3.min.js"></script> -->
<script language="javascript">
    $(document).ready(function(){
        $('#mysubmit').button();
});
</script>
<script language="javascript">
$(document).ready(function() {
    $().ajaxStart(function() {

        $('#loading').show();
        $('#result').hide();
    }).ajaxStop(function() {
        $('#loading').hide();
        $('#result').fadeIn('slow');
    });
    $('#form, #fat, #formulario').submit(function() {
        $.ajax({
            type: 'POST',
            url: $(this).attr('action'),
            data: $(this).serialize(),
            success: function(data) {
                $('#result').html(data);

            }
        })
        clear_textbox();

        return false;
    });
})
</script>
<script>
  function validadatos(){
      if(!vacio(document.formulario.codigo.value)){
      alerta("Debe ingresar un codigo de barra","Aviso");
      document.formulario.codigo.focus();
      return false;
      }
  }
</script>
<script language=JavaScript>
function clear_textbox()
{
    document.formulario.reset();
}
</script>
</head>

<body onload="document.forms.formulario.codigo.focus()">
<?php
$orden_flete = $_GET['orden_flete'];
if($orden_flete !=  NULL)
{
    if($_SESSION['ordenflete']  ==  NULL)
    {
        $_SESSION['ordenflete'] = $orden_flete;
    }
    else
    {
        $orden_flete = $_SESSION['ordenflete'];
    }
}
else
{
    if($_SESSION['ordenflete'] != NULL)
    {
        $orden_flete = $_SESSION['ordenflete'];
    }
}

?>
<br />
<div id="titulo_seccion">
    <fieldset>
        <table>
            <tr>
                <td><font>Proceso Finiquito de Facturas</font></td>
            </tr>
        </table>
    </fieldset>
</div>

<fieldset>
<legend>Codigo de barra</legend>
<form action="proceso_finiquito_factura.php" name="formulario" id="formulario" autocomplete="off" method="post" onsubmit="return validadatos();">
<input type="text" name="codigo" />
<input type="submit" name="mysubmit" id="mysubmit" value="Enviar" />
</form>
</fieldset>

<div id="loading"></div>
<div id="result"></div>
</body>
</html>
